home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / superdog.swf / scripts / DefineSprite_1730 / frame_2 / DoAction.as
Encoding:
Text File  |  2007-06-25  |  3.2 KB  |  178 lines

  1. function zhao()
  2. {
  3.    zi++;
  4.    if(zi >= 75)
  5.    {
  6.       zi = 0;
  7.       acted = true;
  8.       this.gotoAndPlay("σżσöñ");
  9.    }
  10. }
  11. function shakechong()
  12. {
  13.    if(this._x > 0)
  14.    {
  15.       _parent.play();
  16.       this.gotoAndStop("Θ£çσè¿");
  17.       this._xscale = 100;
  18.       this._x -= movspd * 1.2;
  19.    }
  20.    else
  21.    {
  22.       this.gotoAndStop("Θóäσñç");
  23.       this._xscale = -100;
  24.    }
  25. }
  26. function chong()
  27. {
  28.    if(dix == false)
  29.    {
  30.       if(this._x > 50)
  31.       {
  32.          ii++;
  33.          if(ii > 40)
  34.          {
  35.             this._x -= movspd;
  36.          }
  37.          this.gotoAndStop("σå▓");
  38.          this._xscale = 100;
  39.       }
  40.       else
  41.       {
  42.          ii = 0;
  43.          this.gotoAndStop("τ½Ö");
  44.          this._xscale = -100;
  45.          dix = true;
  46.          acted = false;
  47.          stoped = true;
  48.       }
  49.    }
  50.    else if(dix == true)
  51.    {
  52.       if(this._x < 530)
  53.       {
  54.          ii++;
  55.          if(ii > 40)
  56.          {
  57.             this._x += movspd;
  58.          }
  59.          this.gotoAndStop("σå▓");
  60.          this._xscale = -100;
  61.       }
  62.       else
  63.       {
  64.          ii = 0;
  65.          this.gotoAndStop("τ½Ö");
  66.          this._xscale = 100;
  67.          dix = false;
  68.          acted = false;
  69.          stoped = true;
  70.       }
  71.    }
  72. }
  73. function zoul()
  74. {
  75.    if(long >= -150 and this._x > 60)
  76.    {
  77.       this._x -= movspd / 4;
  78.       long -= movspd / 4;
  79.       this._xscale = 100;
  80.       this.gotoAndStop("Φ╡░");
  81.    }
  82.    else
  83.    {
  84.       long = 0;
  85.       acted = false;
  86.    }
  87. }
  88. function zour()
  89. {
  90.    if(long <= 150 and this._x < 520)
  91.    {
  92.       this._x += movspd / 4;
  93.       long += movspd / 4;
  94.       this._xscale = -100;
  95.       this.gotoAndStop("Φ╡░");
  96.    }
  97.    else
  98.    {
  99.       long = 0;
  100.       acted = false;
  101.    }
  102. }
  103. function penhuo()
  104. {
  105.    if(fired == false)
  106.    {
  107.       this.gotoAndPlay("σû╖τü½");
  108.       fired = true;
  109.    }
  110. }
  111. stop();
  112. var dix = false;
  113. var acted = false;
  114. var i = 0;
  115. var ii = 0;
  116. var actnum = null;
  117. var long = 0;
  118. var fired = false;
  119. var zi = 0;
  120. onEnterFrame = function()
  121. {
  122.    if(_parent._parent.pauses == false and shakeNow == true)
  123.    {
  124.       acted = true;
  125.       shakechong();
  126.    }
  127.    if(behit == false)
  128.    {
  129.       if(ofen_zhao == true)
  130.       {
  131.          zhao();
  132.       }
  133.       if(zhaohuan == true and acted == false and stoped == false and hp > 4)
  134.       {
  135.          this.gotoAndPlay("σżσöñ");
  136.          acted = true;
  137.          zhaohuan = false;
  138.       }
  139.       if(hp <= maxhp * aa and acted == false and stoped == false)
  140.       {
  141.          aa -= 0.2;
  142.          this.gotoAndPlay("σżσöñ");
  143.          acted = true;
  144.       }
  145.       if(acted == false and stoped == false and _parent.flywar == false)
  146.       {
  147.          actnum = random(4);
  148.          acted = true;
  149.       }
  150.       if(stoped == true)
  151.       {
  152.          i++;
  153.          if(i >= 60)
  154.          {
  155.             i = 0;
  156.             stoped = false;
  157.          }
  158.       }
  159.       if(ofen_zhao == false)
  160.       {
  161.          switch(actnum)
  162.          {
  163.             case 0:
  164.                chong();
  165.                break;
  166.             case 1:
  167.                zoul();
  168.                break;
  169.             case 2:
  170.                zour();
  171.                break;
  172.             case 3:
  173.                penhuo();
  174.          }
  175.       }
  176.    }
  177. };
  178.